<%--
  Created by IntelliJ IDEA.
  User: 86917
  Date: 2020/10/29
  Time: 15:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<%@include file="../layout/header.jsp" %>
<%@include file="../layout/script.jsp" %>
<head>
    <title>Title</title>
    <style>
        .table tbody tr.active {
            background: skyblue;
        }
        #syy.disabled,
        #xyy.disabled {
            color: #ccc;
            pointer-events: none;
        }
        #seachTop{
            display: flex;
        }
    </style>
</head>
<script type="text/javascript">
    $(document).ready(function () {
        //点击链接的时候调用
        $("#chaxun").click(function () {

            //得到input的值
            var arcNumsel = $("#arcNumsel").val();
            var checkNum = $("#checkNum").val();
            var prjName = $("#prjName").val();
            var prjAddr = $("#prjAddr").val();
            //设置linkToCart的href的值
            $("#chaxun").attr("href", "${pageContext.request.contextPath}/arc_main/list?featureType=${mapData.get("featureType")}&arcNumsel=" +
                arcNumsel + "&checkNum=" + checkNum + "&prjName=" + prjName + "&prjAddr=" + prjAddr);
        });
        $("#syy").click(function () {
            //得到input的值
            var arcNumsel = $("#arcNumsel").val();
            var checkNum = $("#checkNum").val();
            var prjName = $("#prjName").val();
            var prjAddr = $("#prjAddr").val();
            var pageNo = ${pageInfo.pageNum}-1;
            if (pageNo < 1) {
                pageNo = 1;
            }
            //设置linkToCart的href的值
            var rul = "${pageContext.request.contextPath}/arc_main/list?pageNo=" + pageNo +
                "&featureType=${mapData.get("featureType")}&arcNumsel=" + arcNumsel + "&checkNum=" +
                checkNum + "&prjName=" + prjName + "&prjAddr=" + prjAddr;
            $("#syy").attr("href", rul);
            judgePageBtnState(pageNo)
        });

        $("#xyy").click(function () {
            //得到input的值
            var arcNumsel = $("#arcNumsel").val();
            var checkNum = $("#checkNum").val();
            var prjName = $("#prjName").val();
            var prjAddr = $("#prjAddr").val();
            var pageNo = ${pageInfo.pageNum}+1;
            if (pageNo >${pageInfo.pages}) {
                pageNo =${pageInfo.pages};
            }
            var rul = "${pageContext.request.contextPath}/arc_main/list?pageNo=" + pageNo +
                "&featureType=${mapData.get("featureType")}&arcNumsel=" + arcNumsel + "&checkNum=" +
                checkNum + "&prjName=" + prjName + "&prjAddr=" + prjAddr;
            //设置linkToCart的href的值
            $("#xyy").attr("href", rul);
            judgePageBtnState(pageNo)
        });
        function judgePageBtnState(curPage) {
            var totalPages = ${pageInfo.pages}
            if (curPage == 1) {
                $('#syy').addClass('disabled').attr('disabled', true)
            } else {
                $('#syy').removeClass('disabled').attr('disabled', false)
            }
            if (curPage == totalPages) {
                $('#xyy').addClass('disabled').attr('disabled', true)
            } else {
                $('#xyy').removeClass('disabled').attr('disabled', false)
            }
        }
        $('.detail').on('click', function() {
            $(this).parents('tr').addClass('active').siblings().removeClass('active')
        })
        judgePageBtnState(${pageInfo.pageNum} || 1)
    });
</script>
<style>

</style>
<body id="arcbody">
<div id="arcfilediv" style="width: 100%;height: 100%;overflow: auto;padding:0 10px">
    <div>
        <!-- <div class="col-md-12">
            <div class="col-md-4" id="seachTop">
                <span style="font-weight: 600;" class="col-md-3">档号：</span>
                <input type="text" class="form-control col-md-7" name="arcNumsel" id="arcNumsel" value="${mapData.get("arcNumsel")}">
            </div>
            <div class="col-md-4" id="seachTop">
                <span style="font-weight: 600;" class="col-md-3">项目名称：</span>
                <input type="text" class="form-control col-md-7" name="prjName" id="prjName" value="${mapData.get("prjName")}">
            </div>
            <div class="col-md-4" id="seachTop">
                <span style="font-weight: 600;" class="col-md-3">合格证号：</span>
                <input type="text" class="form-control col-md-7" name="checkNum" id="checkNum" value="${mapData.get("checkNum")}">
            </div>
        </div>
        <div class="col-md-12">
            <div class="col-md-4" id="seachTop">
                <span style="font-weight: 600;" class="col-md-3">工程地址：</span>
                <input type="text" class="form-control col-md-7" name="prjAddr" id="prjAddr" value="${mapData.get("prjAddr")}">
            </div>
            <div class="col-md-4">
                <a href="" class="col-md-6" id="chaxun"><input type="button" class="btn btn-info" value="查询"></a>
            </div>
        </div> -->
        <table style="width: 100%;height: 100px">
            <!-- <tr style="height: 20px"></tr> -->
            <tr>
                <td style="width: 140px;" align="right">档号:&nbsp;&nbsp;</td>
                <td style="width: 270px;"><input type="text" class="form-control input-sm" name="arcNumsel" id="arcNumsel" value="${mapData.get("arcNumsel")}"></td>
                <td style="width: 140px;" align="right">项目名称:&nbsp;&nbsp;</td>
                <td style="width: 270px;"><input type="text" class="form-control input-sm" name="prjName" id="prjName" value="${mapData.get("prjName")}"></td>
                <td style="width: 140px;" align="right">合格证号:&nbsp;&nbsp;</td>
                <td style="width: 270px;"><input type="text" class="form-control input-sm" name="checkNum" id="checkNum" value="${mapData.get("checkNum")}"></td>
                <td style="width: 140px;" align="right">工程地址:&nbsp;&nbsp;</td>
                <td style="width: 270px;"><input type="text" class="form-control input-sm" name="prjAddr" id="prjAddr" value="${mapData.get("prjAddr")}"></td>
                <td align="center" style="width: 140px;"><a href="" id="chaxun"><input type="button" class="btn btn-info" value="查询"></a></td>
                <td></td>
            </tr>
            <!-- <tr>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td align="center"><a href="" id="chaxun"><input type="button" value="查询"></a></td>
            </tr> -->
        </table>
    </div>
    <table class="table table-bordered">
        <thead>
        <tr>
            <td align="center" hidden="hidden">id</td>
            <td align="center">档案类型</td>
            <td align="center">档号</td>
            <td align="center">许可证号</td>
            <td align="center">项目名称</td>
            <td align="center">建设单位</td>
            <td align="center">建设地址</td>
            <td align="center">总卷数</td>
            <td align="center">文件张数</td>
            <td align="center">图纸张数</td>
            <td align="center">照片张数</td>
            <td align="center">操作</td>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${pageInfo.list}" var="record">
            <tr>
                <td align="center" hidden="hidden">${record.id}</td>
                <td align="center">${record.featureName}</td>
                <td align="center">${record.arcNum}</td>
                <td align="center">${record.acpNum}</td>
                <td align="center">${record.prjName}</td>
                <td align="center">${record.bfName}</td>
                <td align="center">${record.prjAdr}</td>
                <td align="center">${record.files}</td>
                <td align="center">${record.papers}</td>
                <td align="center">${record.graphs}</td>
                <td align="center">${record.photos}</td>
                <td align="center"><a class="detail" href="${pageContext.request.contextPath}/arc_file/fileIndex?arcNum=${record.arcNum}">详情</a></td>
            </tr>
        </c:forEach>
        <tr>
            <td colspan="28" style="text-align: right">
                共${pageInfo.pages}页,当前页${pageInfo.pageNum},
                <a id="syy" href="">上一页</a>,
                <a id="xyy" href="">下一页</a>
            </td>
        </tr>

        </tbody>
    </table>
</div>
</body>
</html>
